﻿using System;
using System.Workflow.Activities;
using PD.DataAccess;

namespace PD.WorkflowLibrary.ExternalData
{
    /// <summary>
    /// Represents the data sent when an event is raised using the System.Workflow.Activities.HandleExternalEventActivity activity.
    /// </summary>
    [Serializable]
    public class TaskUpdatedEventArgs : ExternalDataEventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TaskUpdatedEventArgs"/> class.
        /// </summary>
        /// <param name="taskId">The identifier of updated task.</param>
        /// <param name="modifiedBy">The identifier of user who modified task.</param>
        /// <param name="instanceId">The workflow instance identifier for the workflow instance that contains the System.Workflow.Activities.HandleExternalEventActivity that is expected to handle the event.</param>
        public TaskUpdatedEventArgs(int taskId, Guid modifiedBy, Guid instanceId)
            : base(instanceId)
        {
            this.TaskId = taskId;
            this.ModifiedBy = modifiedBy;
        }

        /// <summary>
        /// Gets the identifier of updated task.
        /// </summary>
        public int TaskId { get; private set; }

        /// <summary>
        /// Gets the identifier of user who modified task.
        /// </summary>
        public Guid ModifiedBy { get; private set; }
    }
}
